import 'package:flutter/material.dart';

import '../services/ScreenAdapter.dart';

class JdButton extends StatelessWidget {
  final Color color;
  final String text;
  final Function callback;
   JdButton({Key? key, this.color=Colors.black, this.text='按钮',required this.callback}) : super(key: key);


  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap:callback(),
      child: Container(
        margin: EdgeInsets.all(5),
        padding: EdgeInsets.all(5),
        height: ScreenAdapter.height(76),
        width: double.infinity,
        decoration: BoxDecoration(
            color: this.color,
            borderRadius: BorderRadius.circular(10)),
        child: Center(
          child: Text(
            '${this.text}',
            style: TextStyle(color: Colors.white),
          ),
        ),
      ),
    );
  }
}
